<!--
  ~ MIT License
  ~
  ~ Copyright (c) 2021-2022 yangrunkang
  ~
  ~ Author: yangrunkang
  ~ Email: yangrunkang53@gmail.com
  ~
  ~ Permission is hereby granted, free of charge, to any person obtaining a copy
  ~ of this software and associated documentation files (the "Software"), to deal
  ~ in the Software without restriction, including without limitation the rights
  ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  ~ copies of the Software, and to permit persons to whom the Software is
  ~ furnished to do so, subject to the following conditions:
  ~
  ~ The above copyright notice and this permission notice shall be included in all
  ~ copies or substantial portions of the Software.
  ~
  ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  ~ SOFTWARE.
  -->

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      th:replace="index">
<!--css-->
<link th:fragment="css" type="text/css" rel="stylesheet" th:href="${ossStatic} + @{/css/radio-station/index.css}"/>
<link th:fragment="css" type="text/css" rel="stylesheet" th:href="${ossStatic} + @{/css/common/img.css}"/>
<!--脚本-->
<script async="async" th:fragment="js" type="text/javascript" th:src="${ossStatic} + @{/js/radio-station/index.js}"></script>
<script async="async" th:fragment="js" type="text/javascript" th:src="${ossStatic} + @{/js/common/comment.js}" th:if="${session?.cv_user_id}"></script>
<!--编辑器-->
<link th:fragment="css" type="text/css" rel="stylesheet" th:href="'/plugins/cherry/cherry-markdown.min.css?v='+${staticSourceVersion}"/>
<script th:fragment="js" type="text/javascript" th:src="${ossStatic} +@{/plugins/cherry/cherry-markdown.min.js}+'?v='+${staticSourceVersion}"></script>
<div th:fragment="content">
    <div class="container">
        <div class="row g-2">
            <div class="col-lg-9 mb-2">
                <div class="card border-0 rounded-3 p-2" th:inline="text">
                    <div th:if="${radioIndexDto.radioEnhance.uploadStatus.name()} == 'UPLOADED'">
                        <audio style="width: 100%" th:src="${radioIndexDto.radioEnhance.radio.radioUrl}" preload="auto" controls></audio>
                    </div>
                    <h5 class="mt-2">[[${radioIndexDto.radioEnhance.radio.radioIntro}]]</h5>
                    <div th:if="${radioIndexDto.radioEnhance.uploadStatus.name()} == 'UPLOADING'" class="card border-0 rounded-3 p-2 mb-2 alert alert-warning">
                        为了不影响您的使用体验,电台文件技术上做了异步上传。<br/>
                        所以此时此刻,您的电台文件正在努力的上传中,请耐心等待~
                    </div>
                    <div th:if="${radioIndexDto.radioEnhance.uploadStatus.name()} == 'UPLOAD_FAILED'" class="card border-0 rounded-3 p-2 mb-2 alert alert-danger">
                        电台上传失败
                    </div>
                    <div th:replace="fragments/index::content_data_show(${radioIndexDto.radioEnhance.radio.userId},
                                                                            ${radioIndexDto.radioEnhance.memberEnhance.member.userName},
                                                                            ${radioIndexDto.radioEnhance.memberEnhance.member.via},
                                                                            ${radioIndexDto.radioEnhance.contentDataEnhance.contentData.viewNum},
                                                                            ${radioIndexDto.radioEnhance.contentDataEnhance.contentData.commentNum},
                                                                            ${radioIndexDto.radioEnhance.createDate},
                                                                            0
                                                                            )"></div>
                </div>
                <div>
                    <!--未登录提示-->
                    <div class="mt-2" th:if="!${session?.cv_user_id}" th:include="fragments/index::login_tips"></div>
                    <div th:include="fragments/comment::commentList(${radioIndexDto.radioEnhance.listCommentDto.commentEnhanceList},
                                                                    ${radioIndexDto.radioEnhance.listCommentDto.pageDtoList},
                                                                    ${radioIndexDto.radioEnhance.listCommentDto.total},
                                                                    'radio-detail',
                                                                    ${radioIndexDto.radioEnhance.radio.userId},
                                                                    '评论')"></div>
                    <div class="card border-0 rounded-3 p-2 my-2" th:if="${session?.cv_user_id} and ${radioIndexDto.radioEnhance.radio.status.name() == 'NORMAL'}">
                        <div id="comment_area">
                            <div th:include="fragments/comment::comment_box(${radioIndexDto.radioEnhance.radio.radioId},'RADIO','评论')"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-lg-3">
                <div th:include="fragments/index::create_radio"></div>
                <div class="card border-0 rounded-3 p-2 mb-2">
                    <p style="text-align: center" class="m-0 p-1" th:if="!${#strings.isEmpty(radioIndexDto.radioEnhance.memberEnhance.member.via)}">
                        <a th:href="'/profile/'+${radioIndexDto.radioEnhance.memberEnhance.member.userId}+'/content'">
                            <img class="lazyload img rounded" th:data-src="${radioIndexDto.radioEnhance.memberEnhance.member.via}" style="width: 90px;height: 90px;"/>
                        </a>
                    </p>
                    <p style="text-align: center" class="m-0 p-1">
                        <a th:inline="text" th:href="'/profile/' + ${radioIndexDto.radioEnhance.radio.userId}+'/content'" class="text-black-50 cv-link" style="font-size: 14px">
                            [[${radioIndexDto.radioEnhance.memberEnhance.member.userName}]]
                        </a>
                    </p>
                    <div>
                        <p style="text-align: center" class="m-0 p-1">
                            <a class="cv-link text-black-50 small" th:inline="text" th:href="'/profile/'+${radioIndexDto.radioEnhance.memberEnhance.member.userId}+'/message'"><img style=" width: 20px;height: 20px" class="lazyload" th:data-src="${ossStatic} + @{/icons/system/goutong.png}"> 和作者沟通</a>
                        </p>
                    </div>
                    <div>
                        <p style="text-align: center" class="text-black-50 small m-0 p-1" th:if="!${#strings.isEmpty(radioIndexDto.radioEnhance.memberEnhance.lastActiveTime)}" th:inline="text">最近活跃: [[${radioIndexDto.radioEnhance.memberEnhance.lastActiveTime}]]</p>
                    </div>
                </div>
                <!--访问者-->
                <div th:include="fragments/index::viewList(${radioIndexDto.radioEnhance.viewHistoryEnhanceList})"></div>
                <!--社交模板-->
                <div th:include="fragments/social::social_box('r/','电台',${radioIndexDto.radioEnhance.radio.radioId},${radioIndexDto.radioEnhance.radio.radioIntro})" th:if="${radioIndexDto.radioEnhance.radio.status.name() == 'NORMAL'}"></div>
                <div th:include="fragments/index::global_search"></div>
                <div th:replace="fragments/index::user_manage_fragment(true)"></div>
                <div  th:include="fragments/index::google_right_ad"></div>
            </div>
        </div>
    </div>
</div>
</html>
